<!DOCTYPE html>
<html>
<head>
<title>编辑会员</title>
#include("../include/common.html")
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>编辑会员</h5>
            </div>
           <form id="inputForm" action="update" method="post">
                <input type="hidden" name="id" value="#(member.id)" />
                <div class="ibox-content">
                    <div class="form-horizontal clearfix">
                    	<div class="form-group">
                            <label class="col-sm-3 control-label">会员等级：</label>
                            <div class="col-sm-3">
                                <select class="form-control" name="memberRankId">
                                    <option value="">--请选择--</option>
                                    #for(memberRank : memberRanks)
                                        <option value="#(memberRank.id)" #if(member.memberRankId==memberRank.id) selected #end>#(memberRank.name)</option>
                                    #end
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                      <div class="row">
                            <label class="col-sm-3 control-label">上级：</label>
                            <div class="col-sm-3">
                            	<input type="hidden" name="memberId" id="memberId" value="#if(member.parentId??)#(member.parentId)#end" /> 
                                <input class="form-control" type="text" id="memberName" value="#if(member.parentId??)#(member.parent.nickname)#end" readonly="readonly">
                            </div>
                            <div class="col-sm-2">
                            	<button type="button" class="btn btn-primary" style="" id="chooseMember">选择</button>
                            </div>
                            </div>
                      </div>
                    </div>
                </div>
                <div class="modal-footer col-sm-3 col-sm-offset-2">
                    <button type="submit" class="btn btn-w-m btn-primary">确定</button>
                    <button type="button" class="btn btn-w-m btn-default" onclick="history.back(); return false;">取消</button>
                </div>
            </form>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">

function chooseMemberCall(memberId,memberName){
	$("#memberId").val(memberId);
	$("#memberName").val(memberName);
}


$("#chooseMember").click(function(){
	$.dialog({ width: '950px',
	    height: 500,
	    content: 'url:#(base)/admin/member/choose'});
});

$().ready(function() {

    var $inputForm = $("#inputForm");
    
    // 表单验证
    $inputForm.validate({
        rules: {
        }
    });

});
</script>